package com.rfqx.service;

import java.util.List;

import com.rfqx.dao.CustomerDao;
import com.rfqx.entity.Customer;

public class CustomerService {
	
	private CustomerDao dao;
	
	public CustomerService() {
		dao = new CustomerDao();
	}
	
	public List<Customer> listAll() {
		return dao.listAll();
	}

	public Customer save(Customer customer) {
		
		if (customer.getId() == null) {
			dao.create(customer);
		} else {
			dao.update(customer);
		}
		return customer;
	}
	
}
